#ifndef GS_GARBAGECOLLECTOR_H
#define GS_GARBAGECOLLECTOR_H

namespace Gs
{
	class Managed;
	class Context;

	// Represents a garbage collector for a Context.
	class GarbageCollector
	{
	private:
		Managed *_head;

	public:
		// Initialises a new instance of the GarbageCollector class.
		GarbageCollector();

		// Destroys the instance.
		~GarbageCollector();

		// Adds a new managed object to the garbage collector.
		void AddManagedObject(Managed *object);

		// Manually marks a managed object before a collection cycle.
		void MarkManagedObject(Managed *object);

		// Performs a full garbage collection cycle.
		void Collect(Context *context);
	};
}

#endif